package com.cfx.exercise_42;

import java.util.Random;

public class InitArr {

	public static void main(String[] args) {
		/*int[] arr = {1,2,3,4,5,6,7,8,9,10};
		int temp = arr[0];
		for (int i = 0; i < arr.length; i++) {
			
			if(i<arr.length-1){
				arr[i] = arr[i+1];
			}			
		}
		arr[arr.length-1] = temp;
		for (int i : arr) {
			System.out.println(i);
		}*/
		
		/*int[] arr = new int[40];
		Random ran = new Random();
		int num = 0;
		for (int i = 0; i < arr.length; i++) {
			arr[i] = ran.nextInt(100);
			num+=arr[i];
		}
		int aver = num/40;
		System.out.println(aver+"pingjunshu");
		for (int i = 0; i < arr.length; i++) {
			if(arr[i]<aver){
				//System.out.println(arr[i]);
			}
		}
		Sort.selectSort(arr);
		for (int i = 0; i < arr.length; i++) {
			System.out.println(arr[i]);
		}*/
		Random ran = new Random();
		int[][] arr1 = new int[20][5];
		int[] num = new int[20];
		
		System.out.println("\tC++    Java  Servlet    Jsp     EJB");
		System.out.println("-------------------------------------------------");
		for (int i = 0; i < arr1.length; i++) {			
			int cor = 0;
			int[] arr2 = arr1[i];
			System.out.print("学生"+(i+1)+":");
			for (int j = 0; j < arr2.length; j++) {
				arr2[j] = ran.nextInt(100);
				cor+=arr2[j];
				System.out.print("\t"+arr2[j]);
				if(j==arr2.length-1){
					System.out.println();
				}
			}
			for (int k = 0; k < num.length; k++) {				
				num[i] = cor;			
			}
			System.out.println("总分："+num[i]);
			System.out.println("-------------------------------------------------");
		}
		
		
	}
}
